//
//  NSString+TextSize.h
//  EverVCiOSClient
//
//  Created by 张可可 on 15/10/12.
//  Copyright (c) 2015年 EverVC. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  计算文字所占区域大小
 */
@interface NSString (TextSize)


- (CGFloat)textHeightWithWidth:(CGFloat)width fontSize:(CGFloat)fontSize;
- (CGFloat)textHeightWithWidth:(CGFloat)width font:(UIFont *)font;
- (CGFloat)textHeightWithWidth:(CGFloat)width textAttributed:(NSDictionary *)attributtedDic;

- (CGFloat)textWidthWithHeight:(CGFloat)height fontSize:(CGFloat)fontSize;
- (CGFloat)textWidthWithHeight:(CGFloat)height font:(UIFont *)font;
- (CGFloat)textWidthWithHeight:(CGFloat)height textAttributed:(NSDictionary *)attributtedDic;


#pragma mark - 获取 字体属性字典
///  lineSpzcing : 默认5
+ (NSDictionary *)calculateAttributeDicWithFontSize:(CGFloat)fontSize lineSpacing:(CGFloat)lineSpacing;
+ (NSDictionary *)attributeDicWithFontSize:(CGFloat)fontSize textColor:(UIColor *)textColor;
+ (NSDictionary *)attributeDicWithFontSize:(CGFloat)fontSize textColor:(UIColor *)textColor lineSpacing:(CGFloat)lineSpacing;
@end

@interface NSAttributedString (TextSize)

- (CGFloat)textHeightWithWidth:(CGFloat)width;

@end
